<div class="primary">
   <div class="wrap">
      <?php include ROOT.'/home/view/view_bar.php'?>
      <div class="breadcrumb">
         <span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
            <a itemprop="url" rel="up" class="crumb" href="/"><span itemprop="title">Trang chủ</span></a>
            <span class="arrow"> &gt; </span>
         </span>
         <span itemtype="http://data-vocabulary.org/Breadcrumb" itemscope="itemscope" class="crumb_item">
            <a itemprop="url" rel="up" class="crumb" href="/dich-vu/"><span itemprop="title">Dịch vụ</span></a>
            <?=$breadcrum_str == '' ? '' : '<span class="arrow"> &gt; </span>'?>
         </span>
         <?=$breadcrum_str?>
      </div>
      <div class="products_wrap">
         <div class="anybanner">
            <a href="" target="_blank"><img src="http://cdn.tgdd.vn/qcao/09_10_2014_16_14_40_smartphone-hot-1.jpg" alt="" width="1170" height="120"/></a>
         </div>
         <div class="products_list services_list">
            <div class="services_list_left">
               <div class="services_list_title">
                  <h1><?=$curr_cat['cat_name']?></h1>
               </div>
               <div class="services_list_main">
               <?php
               $num_service = 0;
               foreach($list_services as $service) {
                  $num_service++;
                  ?>
                  <div class="proitem">
                     <a href="<?=url_services_detail($service)?>">
                        <img src="<?=img_link($service['ser_image'],'small')?>" alt="<?=$service['ser_name']?>" />
                        <h3 class="name"><?=$service['ser_name']?></h3>
                        <p class="price">Bảo hành: <?=$service['ser_warranty']?></p>
                     </a>
                  </div>
                  <?php
               }
               ?>
               </div>
               <?php
               if($total_products == 0) {
                  echo '<h3>Không có dịch vụ nào được tìm thấy !</h3>';
               }elseif($total_products == 20) {
                  ?>
                  <button class="btnmorelist more_services" data-page="2" data-query="<?=base64_encode(json_encode($query_cat))?>">Xem thêm dịch vụ</button>
                  <script>
                     $('.more_services').click(function(){
                        var query = $(this).attr('data-query');
                        var page = $(this).attr('data-page');
                        var data = {name:'more_services',query:query,page:page};
                        loadAjax(data,'json',{
                           success:function(res) {
                              if(res.status == 1) {
                                 $('.services_list_main').append(res.html);
                                 $('.imgloading').remove();
                                 page++;
                                 $('.more_services').attr('data-page',page);
                              }else if(res.status == 2) {
                                 $('.services_list_main').append(res.html);
                                 $('.imgloading').remove();
                                 $('.more_services').remove();
                              }else {
                                 $('.imgloading').remove();
                                 $('.more_services').remove();
                              }
                           },
                           beforeSend:function() {
                              $('.products_list').append('<img style="display: inherit; margin: 5px auto;" class="imgloading" src="/themes/img/loadingcmt.GIF" />');
                           } 
                        });
                     });
                  </script>
                  <?php
               }
               ?>
            </div>
            <div class="services_list_right">
               <div class="box_cat_services">
                  <div class="box_cat_services_title">
                     <a href="<?=url_services_cat()?>" class="nav_active">
                        <i class="icon_services"></i>
                        <h3>Lựa chọn dịch vụ</h3>
                     </a>
                  </div>
                  <div class="box_cat_services_main">
                     <ul class="sercatlv1">
                     <?php
                     $cat_service1 = db_array('SELECT * FROM categories WHERE cat_type = "services" AND cat_parent_id = 0 ORDER BY cat_order');
                     foreach($cat_service1 as $cat1) {
                        ?>
                        <li<?=$cat1['cat_alias'] == $_GET['catalias'] ? ' class="active"' : ''?>>
                           <a href="<?=url_services_cat($cat1['cat_alias'])?>"><?=$cat1['cat_name']?></a>
                           <ul class="sercatlv2">
                           <?php
                           $cat_service2 = db_array('SELECT * FROM categories WHERE cat_type = "services" AND cat_parent_id = '.$cat1['cat_id'].' ORDER BY cat_order');
                           foreach($cat_service2 as $cat2) {
                              ?>
                              <li<?=$cat2['cat_alias'] == $_GET['catalias'] ? ' class="active"' : ''?>><a href="<?=url_services_cat($cat2['cat_alias'])?>"><?=$cat2['cat_name']?></a></li>
                              <?
                           }
                           ?>
                           </ul>
                        </li>
                        <?
                     }
                     
                     ?>
                     </ul>
                  </div>
               </div>
            </div>
            <ul class="list_service">
               <div class="clear"></div>
            </ul>
         </div>
      </div><!-- products_wrap -->
   </div>
</div>